#pragma once

#include "../mqcommon/log.hpp"
#include "../mqcommon/msg.pb.h"

#include <iostream>
#include <mutex>
#include <memory>
#include <vector>
#include <functional>

namespace mymq
{
    struct Consumer
    {
        using CallBack = std::function<void(const std::string&, const BasicProperties *bp, const std::string&)>;
        using ptr = std::shared_ptr<Consumer>;
        std::string tag;   // 消费者标识
        std::string qname; // 消费者订阅的队列名称
        bool auto_ack;     // 自动确认标志
        CallBack callback;
        Consumer(const std::string &ctag, const std::string &queue_name, bool ack_flag, const CallBack &cb)
            : tag(ctag), qname(queue_name), auto_ack(ack_flag), callback(cb)
        {
            DEBUG_LOG("new Consumer:%p", this);
        }
        Consumer()
        {
            DEBUG_LOG("new Consumer:%p", this);
        }
        ~Consumer()
        {
            DEBUG_LOG("del Consumer:%p", this);
        }
    };
}